home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / xstr.z / xstr
Text File  |  1998-10-20  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4. XXXXSSSSTTTTRRRR((((1111))))                                                                XXXXSSSSTTTTRRRR((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      xstr - extract strings from C programs to implement shared strings
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      xxxxssssttttrrrr [ ----vvvv ] [ [ ----cccc ] [ ---- ] [ file ]
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _X_s_t_r maintains a file _s_t_r_i_n_g_s into which strings in component parts of a
  16.      large program are hashed.  These strings are replaced with references to
  17.      this common area.  This serves to implement shared constant strings, most
  18.      useful if they are also read-only.  The -v flag makes _x_s_t_r verbose.
  19.  
  20.      The command
  21.  
  22.           xxxxssssttttrrrr ----cccc name
  23.  
  24.      will extract the strings from the C source in name, replacing string
  25.      references by expressions of the form (&xstr[number]) for some number.
  26.      An appropriate declaration of _x_s_t_r is prepended to the file.  The
  27.      resulting C text is placed in the file _x._c, to then be compiled.  The
  28.      strings from this file are placed in the _s_t_r_i_n_g_s data base if they are
  29.      not there already.  Repeated strings and strings which are suffices of
  30.      existing strings do not cause changes to the data base.
  31.  
  32.      After all components of a large program have been compiled a file _x_s._c
  33.      declaring the common _x_s_t_r space can be created by a command of the form
  34.  
  35.           xxxxssssttttrrrr
  36.  
  37.      This _x_s._c file should then be compiled and loaded with the rest of the
  38.      program.  If possible, the array can be made read-only (shared) saving
  39.      space and swap overhead.
  40.  
  41.      _X_s_t_r can also be used on a single file.  A command
  42.  
  43.           xxxxssssttttrrrr name
  44.  
  45.      creates files _x._c and _x_s._c as before, without using or affecting any
  46.      _s_t_r_i_n_g_s file in the same directory.
  47.  
  48.      It may be useful to run _x_s_t_r after the C preprocessor if any macro
  49.      definitions yield strings or if there is conditional code which contains
  50.      strings which may not, in fact, be needed.  _X_s_t_r reads from its standard
  51.      input when the argument `-' is given.  An appropriate command sequence
  52.      for running _x_s_t_r after the C preprocessor is:
  53.  
  54.           cccccccc ----EEEE  name.c | xxxxssssttttrrrr ----cccc -
  55.           cccccccc ----cccc x.c
  56.           mmmmvvvv x.o name.o
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XXXXSSSSTTTTRRRR((((1111))))                                                                XXXXSSSSTTTTRRRR((((1111))))
  71.  
  72.  
  73.  
  74.      _X_s_t_r does not touch the file _s_t_r_i_n_g_s unless new items are added, thus
  75.      _m_a_k_e can avoid remaking _x_s._o unless truly necessary.
  76.  
  77. FFFFIIIILLLLEEEESSSS
  78.      strings        Data base of strings
  79.      x.c       Massaged C source
  80.      xs.c      C source for definition of array `xstr'
  81.      /tmp/xs*  Temp file when `xstr name' doesn't touch _s_t_r_i_n_g_s
  82.  
  83. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  84.      mkstr(1)
  85.  
  86. AAAAUUUUTTTTHHHHOOOORRRR
  87.      William Joy
  88.  
  89. BBBBUUUUGGGGSSSS
  90.      If a string is a suffix of another string in the data base, but the
  91.      shorter string is seen first by _x_s_t_r both strings will be placed in the
  92.      data base, when just placing the longer one there will do.
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.